﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YakShaver.Contract;
namespace YakShaver.Tests.DummyObjects
{
    /// <summary>
    /// Basically acts as a dumb implementation to simply return values I want. Kind of a mock, kind of not.
    /// but can't relaly mock it since I need to pass it over several boundries.
    /// 
    /// I learned this method from a guy at work named Anand Jain.  By using this method we simply want to know
    /// if certain methods were called.  That we do not necssarily want to have in our actual implementation
    /// It requires more coding but does have the benefits of a lot of testing coverage and scenarios
    /// </summary>
    [Serializable]
    public class WorkItemDataContractDummyObject : IWorkItemDataContract
    {
        #region IWorkItemDataContract Members

        public int PageIdGetMethodCallCount = 0;
        public int PageIdSetMethodCallCount = 0;
        private string pageId = "/home/test.aspx";
        public string PageId
        {
            get
            {

                PageIdGetMethodCallCount++;
                return pageId;

            }
            set
            {
                PageIdSetMethodCallCount++;
                pageId = value;
            }
        }

        public int WorkItemTypeGetMethodCallCount = 0;
        public int WorkItemTypeSetMethodCallCount = 0;
        private WorkItemType workItemType = WorkItemType.Unknown;
        public WorkItemType WorkItemType
        {
            get
            {
                WorkItemTypeGetMethodCallCount++;
                return workItemType;
            }
            set
            {
                workItemType = value;
                WorkItemTypeSetMethodCallCount++;
            }
        }

        public int WorkItemImpactTypeGetMethodCallCount = 0;
        public int WorkItemImpactTypeSetMethodCallCount = 0;
        private WorkItemImpactType workItemImpactType = WorkItemImpactType.Unknown;
        public WorkItemImpactType WorkItemImpactType
        {
            get
            {
                WorkItemImpactTypeGetMethodCallCount++;
                return workItemImpactType;
            }
            set
            {
                workItemImpactType = value;
                WorkItemImpactTypeSetMethodCallCount++;
            }
        }

        public int DescriptionSetCallCount = 0;
        public int DescriptionGetCallCount = 0;
        private string description = "Test Description";
        public string Description
        {
            get
            {
                DescriptionGetCallCount++;
                return description;
            }
            set
            {
                DescriptionSetCallCount++;
                description = value;
            }
        }

        public int WorkItemIdGetCallCount = 0;
        public string WorkItemId
        {
            get 
            {
                WorkItemIdGetCallCount++;
                return string.Empty; 
            }
        }

        #endregion

        #region IWorkItemDataContract Members
        private string _title = "Test Title - ";
        public int TitleGetCallCount = 0;
        public int TitleSetCallCount = 0;
        public string Title
        {
            get
            {
                TitleGetCallCount++;
                return _title;
            }
            set
            {
                TitleSetCallCount++;
                _title = value;
            }
        }

        #endregion
    }
}
